package com.malamute.system.service.impl;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.malamute.core.common.Page;
import com.malamute.system.dao.LogDao;
import com.malamute.system.entity.Log;
import com.malamute.system.service.LogService;

/**
 * @author Aceguan
 * @description 日志业务接口
 * @date 2012-2-29 下午07:50:04
 * @version v1.0
 */
@Service
public class LogServiceImpl implements LogService {

	@Autowired
	private LogDao logDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @param log
	 * 
	 * @see
	 * com.malamute.system.service.LogService#saveLog(com.malamute.system.entity
	 * .Log)
	 */
	@Override
	public void saveLog(Log log) {
		logDao.save(log);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @param id
	 * 
	 * @return
	 * 
	 * @see com.malamute.system.service.LogService#getLogById(java.lang.Integer)
	 */
	@Override
	public Log getLogById(Integer id) {
		return logDao.get(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @param log
	 * 
	 * @see
	 * com.malamute.system.service.LogService#updateLog(com.malamute.system.
	 * entity.Log)
	 */
	@Override
	public void updateLog(Log log) {
		logDao.update(log);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @param criteria
	 * 
	 * @param page
	 * 
	 * @see
	 * com.malamute.system.service.LogService#listLogsByPage(org.hibernate.criterion
	 * .DetachedCriteria, com.malamute.core.common.Page)
	 */
	@Override
	public void listLogsByPage(DetachedCriteria criteria, Page page) {
		logDao.listByPage(criteria, page);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @param id
	 * 
	 * @see
	 * com.malamute.system.service.LogService#deleteLogById(java.lang.Integer)
	 */
	@Override
	public void deleteLogById(Integer id) {
		logDao.deleteByKey(id);
	}

}
